<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class CreateElectricFeeTypesTable.
 */
class CreateElectricFeeTypesTable extends Migration
{
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('electric_fee_types', function(Blueprint $table) {
            $table->increments('id');
			$table->string('name');
            $table->decimal('fee');
            $table->string('compute_unit')->comment('每间或每度');
            $table->boolean('level_control')->nullable()->comment('阶梯控制');
            $table->smallInteger('level_from')->nullable()->comment('阶梯下限');
            $table->smallInteger('level_to')->nullable()->comment('阶梯上限');
            $table->boolean('season_control')->nullable()->comment('季节控制');
            $table->tinyInteger('from_month')->nullable();
            $table->tinyInteger('to_month')->nullable();
            $table->string('remark')->nullable();

            $table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('electric_fee_types');
	}
}
